package demo.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * @Title: Entity
 * @Description: 解盘分类
 * @author zhangdaihao
 * @date 2015-09-09 11:11:51
 * @version V1.0
 *
 */
@Entity
@Table(name = "tp_analyze_category", schema = "")
@DynamicUpdate(true)
@DynamicInsert(true)
@SuppressWarnings("serial")
public class AnalyzeCategoryEntity implements java.io.Serializable {
	/** id */
	private java.lang.String id;
	/** 名称 */
	private java.lang.String categoryName;
	/** 编码 */
	private java.lang.String categoryCode;
	// /**parentCategoryId*/
	// private java.lang.String parentCategoryId;
	private AnalyzeCategoryEntity parentCategory;
	/** 有效状态 */
	private java.lang.String status;
	/** createBy */
	private java.lang.String createBy;
	/** createName */
	private java.lang.String createName;
	/** createDate */
	private java.util.Date createDate;
	/** updateBy */
	private java.lang.String updateBy;
	/** updateName */
	private java.lang.String updateName;
	/** updateDate */
	private java.util.Date updateDate;
	/** delflag */
	private java.lang.String delflag;
	/** delDate */
	private java.lang.String delDate;
	
	private List<AnalyzeCategoryEntity> analyzeCategorys = new ArrayList<AnalyzeCategoryEntity>();

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String id
	 */

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "ID", nullable = false, length = 32)
	public java.lang.String getId() {
		return this.id;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String id
	 */
	public void setId(java.lang.String id) {
		this.id = id;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String 名称
	 */
	@Column(name = "CATEGORY_NAME", nullable = true, length = 32)
	public java.lang.String getCategoryName() {
		return this.categoryName;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String 名称
	 */
	public void setCategoryName(java.lang.String categoryName) {
		this.categoryName = categoryName;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String 编码
	 */
	@Column(name = "CATEGORY_CODE", nullable = true, length = 32)
	public java.lang.String getCategoryCode() {
		return this.categoryCode;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String 编码
	 */
	public void setCategoryCode(java.lang.String categoryCode) {
		this.categoryCode = categoryCode;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARENT_CATEGORY_ID")
	public AnalyzeCategoryEntity getParentCategory() {
		return parentCategory;
	}

	public void setParentCategory(AnalyzeCategoryEntity parentCategory) {
		this.parentCategory = parentCategory;
	}

	// /**
	// *方法: 取得java.lang.String
	// *@return: java.lang.String parentCategoryId
	// */
	// @Column(name ="PARENT_CATEGORY_ID",nullable=true,length=32)
	// public java.lang.String getParentCategoryId(){
	// return this.parentCategoryId;
	// }
	//
	// /**
	// *方法: 设置java.lang.String
	// *@param: java.lang.String parentCategoryId
	// */
	// public void setParentCategoryId(java.lang.String parentCategoryId){
	// this.parentCategoryId = parentCategoryId;
	// }
	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String 有效状态
	 */
	@Column(name = "STATUS", nullable = true, length = 2)
	public java.lang.String getStatus() {
		return this.status;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String 有效状态
	 */
	public void setStatus(java.lang.String status) {
		this.status = status;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String createBy
	 */
	@Column(name = "CREATE_BY", nullable = true, length = 32)
	public java.lang.String getCreateBy() {
		return this.createBy;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String createBy
	 */
	public void setCreateBy(java.lang.String createBy) {
		this.createBy = createBy;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String createName
	 */
	@Column(name = "CREATE_NAME", nullable = true, length = 32)
	public java.lang.String getCreateName() {
		return this.createName;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String createName
	 */
	public void setCreateName(java.lang.String createName) {
		this.createName = createName;
	}

	/**
	 * 方法: 取得java.util.Date
	 *
	 * @return: java.util.Date createDate
	 */
	@Column(name = "CREATE_DATE", nullable = true)
	public java.util.Date getCreateDate() {
		return this.createDate;
	}

	/**
	 * 方法: 设置java.util.Date
	 *
	 * @param: java.util.Date createDate
	 */
	public void setCreateDate(java.util.Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String updateBy
	 */
	@Column(name = "UPDATE_BY", nullable = true, length = 32)
	public java.lang.String getUpdateBy() {
		return this.updateBy;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String updateBy
	 */
	public void setUpdateBy(java.lang.String updateBy) {
		this.updateBy = updateBy;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String updateName
	 */
	@Column(name = "UPDATE_NAME", nullable = true, length = 32)
	public java.lang.String getUpdateName() {
		return this.updateName;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String updateName
	 */
	public void setUpdateName(java.lang.String updateName) {
		this.updateName = updateName;
	}

	/**
	 * 方法: 取得java.util.Date
	 *
	 * @return: java.util.Date updateDate
	 */
	@Column(name = "UPDATE_DATE", nullable = true)
	public java.util.Date getUpdateDate() {
		return this.updateDate;
	}

	/**
	 * 方法: 设置java.util.Date
	 *
	 * @param: java.util.Date updateDate
	 */
	public void setUpdateDate(java.util.Date updateDate) {
		this.updateDate = updateDate;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String delflag
	 */
	@Column(name = "DELFLAG", nullable = true, length = 2)
	public java.lang.String getDelflag() {
		return this.delflag;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String delflag
	 */
	public void setDelflag(java.lang.String delflag) {
		this.delflag = delflag;
	}

	/**
	 * 方法: 取得java.lang.String
	 *
	 * @return: java.lang.String delDate
	 */
	@Column(name = "DEL_DATE", nullable = true, length = 32)
	public java.lang.String getDelDate() {
		return this.delDate;
	}

	/**
	 * 方法: 设置java.lang.String
	 *
	 * @param: java.lang.String delDate
	 */
	public void setDelDate(java.lang.String delDate) {
		this.delDate = delDate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "parentCategory")
	public List<AnalyzeCategoryEntity> getAnalyzeCategorys() {
		return analyzeCategorys;
	}

	public void setAnalyzeCategorys(List<AnalyzeCategoryEntity> analyzeCategorys) {
		this.analyzeCategorys = analyzeCategorys;
	}
}
